import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { cameraPatrolTaskUserVO, cameraPatrolTaskUserForm, cameraPatrolTaskUserQuery } from '@/api/camera/camera-patrol-task-user/types';

/**
 * 查询巡视任务-人员列表
 * @param query
 * @returns {*}
 */

export const listcameraPatrolTaskUser = (query?: cameraPatrolTaskUserQuery): AxiosPromise<cameraPatrolTaskUserVO[]> => {
  return request({
    url: '/camera/camera-patrol-task-user/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询巡视任务-人员详细
 * @param cameraPatrolTaskUserId
 */
export const getcameraPatrolTaskUser = (cameraPatrolTaskUserId: string | number): AxiosPromise<cameraPatrolTaskUserVO> => {
  return request({
    url: '/camera/camera-patrol-task-user/' + cameraPatrolTaskUserId,
    method: 'get'
  });
};

/**
 * 新增巡视任务-人员
 * @param data
 */
export const addcameraPatrolTaskUser = (data: cameraPatrolTaskUserForm) => {
  return request({
    url: '/camera/camera-patrol-task-user',
    method: 'post',
    data: data
  });
};

/**
 * 修改巡视任务-人员
 * @param data
 */
export const updatecameraPatrolTaskUser = (data: cameraPatrolTaskUserForm) => {
  return request({
    url: '/camera/camera-patrol-task-user',
    method: 'put',
    data: data
  });
};

/**
 * 删除巡视任务-人员
 * @param cameraPatrolTaskUserId
 */
export const delcameraPatrolTaskUser = (cameraPatrolTaskUserId: string | number | Array<string | number>) => {
  return request({
    url: '/camera/camera-patrol-task-user/' + cameraPatrolTaskUserId,
    method: 'delete'
  });
};
